package org.edith.shiro.service.impl;

import org.edith.shiro.dao.SysUserDAO;
import org.edith.shiro.dataobject.SysUserDO;
import org.edith.shiro.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

/**
 *  系统用户业务实现
 */
@Service("edithSysUserService")
public class SysUserServiceImpl implements SysUserService {
    @Autowired
    private SysUserDAO sysUserDAO;

    @PostConstruct
    private void createTable(){
        sysUserDAO.createTable();
    }
    /**
     * 根据用户名查询实体
     *
     * @param username 用户名
     * @return SysUserDO 用户实体
     */
    @Override
    public SysUserDO selectUserByName(String username) {
        return this.sysUserDAO.selectUserByName(username);
    }
}